package com.lht.testDemo.four_reference;

import java.lang.ref.SoftReference;

/**
 * @author Eric
 * @version 1.0
 * @date 2019-10-22
 */
public class Soft {

    public static void main(String[] args) throws InterruptedException {

        String value = new String("sy");
        SoftReference sfRefer = new SoftReference(value);

        System.gc();
        Thread.sleep(1000);
        //可以获得引用对象值
        System.out.println(sfRefer.get());

    }

}
